Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
abhaysingh
Specialist II
Specialist II

Set Analysis Help

Hey guys,

i have one exp with the one field i.e.

CurrentTime_Date

i want to define a fromDate and ToDate in My Expression..i cant use Aggregation function since value contain Date and Time..

How can i define it in set Analysis..

{<FromDate = >FromDate and ToDate=    < ToDate>} CurrentTime_Date

Please Suggest

Abhay

14 Replies
Gysbert_Wassenaar

Something like this:

Two helper variables:

vFromDate: =YearStart(Today())

vToDate: =Today()

A set analysis expression using the variables:

Sum( {<CurrentTime_Date={'>=$(vFromDate)<=$(vToDate)'}>} Amount)


talk is cheap, supply exceeds demand
pamaxeed
Partner - Creator III
Partner - Creator III

Hi,

in Qlikview it is something like that
{<[ref date] = {"$(= '>=' & vNumFrom & '<=' & vNumTo)"}


but I am using variable to define FROM and TO Date.

Cheers,

Patric

Not applicable

hello,

you have to create a variable with the date FromDate  and ToDate or other form is in the expression with the fields.

if you compare two dates the decimal or frac part of the number isn't important.

-example in the expression:

sum({<Date={">$(=date(FromDate))<=$(=date(ToDate))"}> }Value)

sorry for my english i'm from chile

abhaysingh
Specialist II
Specialist II
Author

Hi Gysbert,

Actually the problem is I have only one measure which i can not use with Aggr Functions...

Because Measure is Date_Time_Temperature which contain value like below

30-09-15  at 10:44:01 AM

so i can not use Sum,Count etc.

The reason why i am doing is i need to show FromDate to ToDate Range Data in particular report and as i am working on Qliksense, i Dont have Calender Object or Can not Use variables.

so i have created FromDate and ToDate at backend now i require to pass the expression >FromDate and <ToDate so i can get the range of inpput entered by user.

Please Advice..

Abhay

Anonymous
Not applicable

Abhay,

Check this thread for your From and To date implementation....

Re: Is there a way to add Date Picker Calendar object in Qlik Sense?

Hope this help!!

Alvaro_Palacios
Support
Support

Hi Abhay,

If you can't use aggregation functions then try with Only() function.

So declare two variables to include in the set analysis expression:

1) vFromDate: =YearStart(Today())

2) vToDate: =Today()

Create the following set analysis expression using the variables:

Only( {<CurrentTime_Date={'>=$(vFromDate)<=$(vToDate)'}>} Date_Time_Temperature)

Hope this was helpful.

Alvaro P.

jonathandienst
Partner - Champion III
Partner - Champion III

In QS, you can define the variables in script:

Set vFromDate = =YearStart(Today());  // yes that is two = signs with a space

Set vToDate = =Today();

And any QV calendar load script will work in Sense.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
jonathandienst
Partner - Champion III
Partner - Champion III

And you need to split CurrentTime_Date into times and dates:

LOAD

     ...

     CurrentTime_Date,

     Date(Floor(CurrentTime_Date)) As CurrentDate,

     Time(Frac(CurrentTime_Date)) As CurrentTime,

     ...

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Anonymous
Not applicable

Chk the attachment for your Min temp/hour...

Hope this will help!!