Weekly Challenges

Solve the challenge, share your solution and summit the ranks of our Community!

Also available in | Français | Português | Español | 日本語
IDEAS WANTED

Want to get involved? We're always looking for ideas and content for Weekly Challenges.

SUBMIT YOUR IDEA

Challenge #387: LEGO® My Data (Part 2)

PhilipMannering
16 - Nebula
16 - Nebula

Solution attached...

Spoiler
image.png

@patrick_digan Can you use '%Question.List%' in the Filter Tool → [Year] IN ('%Question.List%') ? I could not get this to work.

patrick_digan
17 - Castor
17 - Castor

@PhilipMannering  You sure can! You would either need to change your filter tool or your listbox. The listbox has the ability to specify the string that is sent over, so you just have to make sure the quotes match.

 

Change filter:

 

image.png

Since the listbox already has the quotes, you don't need any quotes in the Filter tool.

 

Change listbox:

image.png

If your filter already has the beginning and end quotes like you mentioned [Year] IN ('%Question.Year%'), then the listbox no longer needs beginning and end quotes (just the separators). You can then test something like 2014/2015:

 

 

 

PhilipMannering
16 - Nebula
16 - Nebula

@patrick_digan. Ah, it's the fact that it %Question.Year% gets replaced without the quotes that was the bit I was missing. Perfect. Thank you!

Yoshiro_Fujimori
14 - Magnetar

As my workspace cannot use Download Tool, I can only follow up to Step 3.

I will do the rest from my home pc.

Spoiler
Workflow
Challenge_387_1.png
App screen

 

App Results
Challenge_387_3.png
hdesai7
8 - Asteroid

One of the toughest I have had the pleasure of working through!

 

Spoiler
Main.png

Spoiler
Screenshot 2023-09-27 at 6.31.14 PM.png

 

tammybrown_tds
8 - Asteroid

Macro practice is a wonderful thing.

 

Spoiler
387 Photo.jpg
alacoume
8 - Asteroid

This one is really hard!

AkimasaKajitani
17 - Castor
17 - Castor

I made the new workflow using Python tool for resolving the Blob error.

 

Spoiler
I use the Python package "Pillow" for this solution.

 
スクリーンショット 2023-10-14 150125.png
I think when the blob error occures, the jpeg file with some trouble is downloaded. But other Windows application can load those jpeg files. So I load them by using Python package "Pillow" and then save as "Correct" jpeg files using Pillow again. After that, I load those "Correct "jpeg files with no error by Image tool. But if we use the Python tool in Batch macro, the workflow is very slow, so I don't use the Batch macro for this solution.

from ayx import Package
Package.installPackages(['Pillow'])


from ayx import Alteryx
from PIL import Image

df = Alteryx.read("#1")
image_list =[]

print(df['DownloadTempFile'])

for img in df['DownloadTempFile']:
    if img is not None:
        with open(img, mode='rb') as f:
            image_file = Image.open(img)
        image_file.save(img+'.jpg', quality=95)
        image_list.append(img+'.jpg')
    else:
        image_list.append(None)
        
df['image_path'] = image_list

Alteryx.write(df,1)

 

 

Sebastian_Chaieb2
8 - Asteroid

Nice! I love it 😍

 

Thanks for this @AkimasaKajitani 

I have to increase my Python skills 💪

networkmike42
8 - Asteroid

This was a lot of fun.  A lot of work, but a lot of fun.

 

Here is the workflow:

 

Spoiler
Screenshot workflow.png

Here is the Macro

 

Spoiler
Screenshot macro.png