Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Showing Past 18 Months Date of selection of Date in Dimension

Hello Qlik Experts,

    On Selecting a Date (Say "Processing Date"), I want to show the "Processing Date" of the past 18 Months in a table.

E.g.: Say I select "Processing Date" as '01-07-2018 (DD-MM-YYYY)', it show show me the "Processing Date" from '01-01-2017 Till 01-07-2018' in a Dimension (i.e. In a Filter or Table).

Thanks in Advance.

5 Replies
dplr-rn
Partner - Master III
Partner - Master III

create 2 variables

vTestDate if(GetSelectedCount(ProcessingDate)=1,ProcessingDate,0)

vTestDateMinus18 =if(GetSelectedCount(ProcessingDate)=1,Date(AddMonths(ProcessingDate,-18)),0)

your expression can use set analysis between these 2 ranges

if(vTestDate=0, Sum( OrderRecordCounter),Sum( {<ProcessingDate={"<=$(=vTestDate) >=$(=vTestDateMinus18)"}>} OrderRecordCounter))

the if condition is to eliminate more than 1 selection.

Not sure i covered all the bases here but i think general approach should work

dplr-rn
Partner - Master III
Partner - Master III

any luck?

zebhashmi
Specialist
Specialist

in set analysis you can use

only({<ProcessingDate = {">=Date(AddMonths(ProcessingDate,-18)"}>} your_Feild)

Anonymous
Not applicable
Author

Hey Dilip,

But what if I select a Date in Particular and it should show all the Dates selected from that Date till 18 months prior.

I want to show it as a dimension, not as a measure.

So say I select 1st July 2018, I want to select all Dates from 1st Jan 2017 till 1st July 2018.

And suppose I select A "Filter Chart", this selected Date range should appear.

dplr-rn
Partner - Master III
Partner - Master III

the date range should appear where?

-in the table? (this should happen with above solution if you add the date mentioned as a dimension)

- or filterbox? (in sense i am not sure if this can be achieved)