Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik and ServiceNow Partner to Bring Trusted Enterprise Context into AI-Powered Workflows. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
463
Contributor II
Contributor II

More date fun

My situation is that I want to display something of a switch with dates in a combo chart (bars and lines).  

If the switch is in the 'A' position, I want to display the values that are in the last file or data set I received for each month from the previous XX months.  If in the 'B' position, I want to display all of the values from the files that I received in the current month.

With Apr as my current month:

Switch A:
Jan  Feb  Mar  Apr

Switch B:
1Apr  7Apr  10Apr  29Apr

And then when May comes around, Switch A would include May, Switch B would be the files loaded in May. No selections or filtering at this stage.  But, let me expand this just a bit as I am thinking for Switch B would be dedicated to show the files loaded in a 'selected' month (I don't want to say drill down but, in essence, that is what is being done.).

I currently have two date fields in my table.  One being the LoadDate (YYYYMMDD) and the other being the LoadMonth (YYMMM). I have one variable to capture the current month.

What would be the expression to filter the last file's values for a month to satisfy Switch A? Is this possible?

What would be the expression to filter the data for the current month to satisfy Switch B?  Is this possible?
= Sum({1<LoadMonth = {"='=vCurrentMonth'"}>} X - Y - Z)
I started with the above expression, but this now doesn't return anything.  I tried to filter or parse the LoadMonth with Date(Date#(LoadMonth,'YYMMM'),'YYMMM') but this didn't help.  What I am doing wrong here?

TIA!

 

 

 

Labels (2)
1 Reply
463
Contributor II
Contributor II
Author

Just wanted to add that I think I got Switch B figured out:

Sum({1<LoadDate={">$(vGetLastMonthEndDT) <$(vGetNextMonthStartDT)" }>} X - Y - Z)