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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Days vs Depth- Script

Hello,

I am having trouble calculating/scripting the cumulative days at a specific depth in QlikView. I currently have an sql table which pulls in the date and the depth at that specific date.  But instead of the date as a dimension I want a count of days up to that specific point.

An aggr(count(Days), Dim) brings in a total count of days which does not work for my analysis.

Ex:

Current:

Depth

   1500

   1000

     500

           3/1/2016 | 3/2/2016 | 3/3/2016 | 3/4/2016 | 3/5/2016 |    days

Goal:

Depth

   1500

   1000

     500

        0 | 1 | 2 | 3 | 4 | 5 |    days

Can someone please advise?

Thanks,

Jared

Labels (1)
2 Replies
swuehl
Champion III
Champion III

Maybe a calculated dimension like

Aggr( days -Min(TOTAL days), days)


edit: Take care that your days date field shows a numeric representation, e.g. by using a default DateFormat in your script


SET DateFormat = 'M/D/YYYY';

sunny_talwar
MVP
MVP

I not sure I understand your setting. Would you be able to share a qvw sample?