Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
soniasweety
Master
Master

selection

Hi All,

Kaushik Solanki

Simone Spanio

i  want to achieve in the dashboad   on open  trigger

by default   current quarter and next 3 quarters [means 4quarters should be selected]

i have quarter field

2017Q1

2017Q2

..

2018Q4

2019Q1

2019Q2

2019Q3

2019Q4

for example current quarter is 2018Q4   so my requirment is    to be default selction   2018Q4,2019Q1,2019Q2,2019Q3

it should be dynamic    ....if i will be in 2019Q1 ...it will treat as 2019Q1 as current  like that

thanks

Sony

8 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

Here is the solution.

Script:

Let vMin = num(MakeDate(2017,01,01));

Let vMax = num(MakeDate(2018,08,01));


Temp:

Load Date($(vMin) + RowNo() -1) as Date

AutoGenerate 1

While Date($(vMin) + RowNo() -1) < Date($(vMax));


Master:

Load Date,

Year(Date) & 'Q'&Ceil(NUm(Month(Date))/3) as YearQtr,

QuarterStart(Date) as QtrStart

Resident Temp;


Drop table Temp;


Trigger Expression:

='('&Concat({<Date = {">$(=Max(QtrStart,4))"}>}distinct YearQtr,'|')&')'

Also QVW is attached.

Regards,

Kaushik Solanki !

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
simospa
Partner - Specialist
Partner - Specialist

Hi Sony,

I attach a solution, creating variables in load script and creating an ID for every quarter.

I inserted the script as onOpen trigger and in the button.

Let me know.

Simone

soniasweety
Master
Master
Author

thanks alot.. i will test from my side also

soniasweety
Master
Master
Author

Hi Sir,

kaushik.solanki

in this variables you are static values are giving ?

Script:

Let vMin = num(MakeDate(2017,01,01));

Let vMax = num(MakeDate(2018,08,01));  ----this value



every time i need to change  current month?

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

This is just for testing, you can change vMax to Today().

So everytime it will get updated with today's date.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
soniasweety
Master
Master
Author

thanks for the info.i will check it

soniasweety
Master
Master
Author

one more doubt

kaushik.solanki

if i dont want to use master calendar here

i have only fisxal quarter values coming as 2017Q1 2017Q2....2018Q3,2018Q4,2019Q1  like so one..  i dnt have date field in my data  directly user is providing the fiscal quarter field.

so how can i achieve this?

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

You need to get the Date field, so that it max(4th Last Max Value) can be found.

You wont be able to get the Max(4th Last Max Value) from string.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!