Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

ramshoney
Contributor

Reagarding Max(date) and Total communication (YearTD)

Hi,

I'm unable to use Max(date) on timestamp date column, where i need to pick the max(date) of the user and need to find his (Total YTD) communication.

I have 4 Columns in my report, Date, CustomerName, Communication type.

This interaction will happen on the map, when I click on CustomerName in the map Then i need to show his related data in the table view with ( his Last Max(date) which is a timestamp column, his Name, and his total interaction YTD ) into a single row.

I'm not able to run Max(date) on that date col and not able to calc YTD interactions.

9 Replies

Re: Reagarding Max(date) and Total communication (YearTD)

Not sure I understand? What expression are you using which isn't working?

ramshoney
Contributor

Re: Reagarding Max(date) and Total communication (YearTD)

Max(date) throwing error.

Re: Reagarding Max(date) and Total communication (YearTD)

What error does it throw?

ramshoney
Contributor

Re: Reagarding Max(date) and Total communication (YearTD)

max(date) giving error, bec i found that date stored in the DB is timestamp. Resolved now by using below one

Date(Floor(Timestamp#(MAX([comm_Date])))).

How to find YTD need help on YTD calcs with specify user selection.

Re: Reagarding Max(date) and Total communication (YearTD)

Usually you can do this

{<Date = {"$(='>=' & Date(YearStart(Max(Date))) & '<=' & Date(Max(Date)))"}>}

ramshoney
Contributor

Re: Reagarding Max(date) and Total communication (YearTD)

Sunny, Thanks for the response.

That wil give the YTD count ?, bec I'm able to find the Maxdate by using Date(Floor(Timestamp#(MAX([comm_Date])))).

But i didnt have any Master Calendar Created. Need to calcuate YTD based on avaiable Date column with specific to his Name, Communication type.

Re: Reagarding Max(date) and Total communication (YearTD)

Change this in the script

Date(Floor(Timestamp#([comm_Date]))) as DateField

and not use DateField in your set analysis

ramshoney
Contributor

Re: Reagarding Max(date) and Total communication (YearTD)

Sunny,

In my DB the comm_date showing data: 2017-01-02 05:00:00

When I import the table into Qliksense,the data I'm seeing for 2017-01-02 05:00:00 is 42737.208333333. in Datamodel Viewer, when i pull the data in the table report its showing 1/2/2017  5:00:00 AM.


unable to apply the Date(Floor(Timestamp#([comm_Date]))) as DateField comm_date its giving null.



Re: Reagarding Max(date) and Total communication (YearTD)

How about this?

Date(Floor(comm_Date)) as DateField?

Community Browser