Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Expression for Button

Hi,

I need to create a button that selects just the last 6 months. I'm not sure of the correct expression to use. Thank you in advance for your help!

9 Replies
sunny_talwar

Try the attached

Not applicable
Author

It's not working. I added a table to this attachment which might make it easier. Thank you!

sunny_talwar

Is it working now?

Created a new field called FiscalDate using Binary Load. You can just create that in your Downtime table using MakeDate function

Date(MakeDate(FiscalYear, Pick(PrdNo, 4, 5, 6, 7, 8, 9, 10, 11, 12, 1, 2, 3), 1)) as FiscalDate

Not applicable
Author

Thanks for the hard work, but it's giving me Sep, Oct, Nov, Dec, Mar & Apr.

sunny_talwar

What are you looking for? What's the last 6 months you would expect?

Not applicable
Author

It's missing Jan & Feb

sunny_talwar

I am not sure what you goal is. The Fiscal date doesn't have values for some of the PrdNo

Capture.PNG

I guess when I press the button, it selects everything between Oct 1st and Apr 1st. Now the table you included, includes a Month field. I am not sure how Month is related to PrdNo. But it seems they are not one to one

Capture.PNG

This seems more like a data modeling issue to me

Not applicable
Author

It's using "Mth", not "Month" - Sorry for the confusion.

sunny_talwar

I mean this table

Capture.PNG

And coming back to the issue again then, we don't have Jan, Feb, Mar. So we only see Oct, Nov, Dec, Apr

Capture.PNG